﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Noodles.Core.Enums;

namespace Noodles.Core.Model
{
    public class BlogPost
    {
        public virtual int BlogID { get; set; }
        [Required]      
        public virtual int PageID { get; set; }
        public virtual string CatID { get; set; }
        public virtual string Title { get; set; }
        [Required]
        [AllowHtml]
        public virtual string PostData { get; set; }
        public virtual DateTime CreateDate { get; set; }
        public virtual int IsPublic { get; set; }
        public virtual bool IsCommentable { get; set; }
        public virtual DateTime UpdateDate { get; set; }
        public virtual int UserID { get; set; }
        public virtual IEnumerable<SelectListItem> Categories { get; set; }
        public virtual IEnumerable<SelectListItem> Pages { get; set; }
        public virtual string Tags { get; set; }
        public virtual BlogStatus IsActive { get; set; }
        public virtual bool IsHomePage { get; set; }
        public virtual string Description { get; set; }
         [UIHint("Comment")]
        public virtual IList<Comments> Comments { get; set; }

         public virtual Comments Comment()
         {
             var CommentNew = new Comments
             {
              blog=this,
              CreateDate=DateTime.Now
             };
             Comments.Add(CommentNew);
             return CommentNew;
         }
       // public virtual List<Comments> Comment { get; set; }
    }
}
